package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysApproveMapper;
import com.ruoyi.system.domain.SysApprove;
import com.ruoyi.system.service.ISysApproveService;
import com.ruoyi.common.core.text.Convert;

/**
 * 审批Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-13
 */
@Service
public class SysApproveServiceImpl implements ISysApproveService 
{
    @Autowired
    private SysApproveMapper sysApproveMapper;

    /**
     * 查询审批
     * 
     * @param approveId 审批ID
     * @return 审批
     */
    @Override
    public SysApprove selectSysApproveById(Long approveId)
    {
        return sysApproveMapper.selectSysApproveById(approveId);
    }

    /**
     * 查询审批列表
     * 
     * @param sysApprove 审批
     * @return 审批
     */
    @Override
    public List<SysApprove> selectSysApproveList(SysApprove sysApprove)
    {
        return sysApproveMapper.selectSysApproveList(sysApprove);
    }

    /**
     * 新增审批
     * 
     * @param sysApprove 审批
     * @return 结果
     */
    @Override
    public int insertSysApprove(SysApprove sysApprove)
    {
        sysApprove.setCreateTime(DateUtils.getNowDate());
        return sysApproveMapper.insertSysApprove(sysApprove);
    }

    /**
     * 修改审批
     * 
     * @param sysApprove 审批
     * @return 结果
     */
    @Override
    public int updateSysApprove(SysApprove sysApprove)
    {
        return sysApproveMapper.updateSysApprove(sysApprove);
    }

    /**
     * 删除审批对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysApproveByIds(String ids)
    {
        return sysApproveMapper.deleteSysApproveByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除审批信息
     * 
     * @param approveId 审批ID
     * @return 结果
     */
    @Override
    public int deleteSysApproveById(Long approveId)
    {
        return sysApproveMapper.deleteSysApproveById(approveId);
    }

    @Override
    public List<SysApprove> selectSysApproveList2(SysApprove sysApprove) {
        return sysApproveMapper.selectSysApproveList2(sysApprove);
    }
}
